package org.example.strategypatterndemo.module1.service.impl;

import org.example.strategypatterndemo.module1.service.PromotionStrategy;
import org.springframework.stereotype.Component;

/**
 * FullReduceStrategy 满减策略
 * @author dingchen
 * @version 2025/05/29 12:33
**/
@Component // 声明为Spring Bean，便于自动装配
public class FullReduceStrategy implements PromotionStrategy {
    @Override
    public double calculateDiscount(double orderAmount) {
        if (orderAmount >= 200) {
            return 50.0; // 满200减50
        }
        return 0.0;
    }
}
